package ev.operator;//need to add this line

//import ev.data.*;//need to add this line
import java.util.Random;

public class bigSwap implements Mutation{
	public boolean[] mutate(boolean[] a) {
		int len=a.length;
		int temp;
		//generate position randomly
		Random r=new Random();
		int position1=r.nextInt(len);
		int position2=r.nextInt(len);
		if(position1>position2){
			temp=position1;
			position1=position2;
			position2=temp;
		}
		//randomly generate it
		for(int i=position1;i<=position2;i++){
			a[i]=r.nextBoolean();	
		}
		return a;
	}

	public int[] mutate(int[] a) {

		int len=a.length;
		int temp;
		//generate two distinct positions randomly
		Random r=new Random();

		int position1=r.nextInt(len);
		int position2=r.nextInt(len);
		if(position1>position2){
			temp=position1;
			position1=position2;
			position2=temp;
		}
		//randomly generate them
		for(int i=position1;i<position2;i++){
			a[i]=r.nextInt(801)+200;	
		}
		return a;
	}	
}
